public class PersonDemo {
    public static void main(String[] args) {
        Person p = new Person( );
        p.setName("张三");
        p.setAge(20);
        p.display( );
    }
}

class Person {
    private String name;
    private int age;
    public String getName() {
        return name;
    }
    public void setName( String name){
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge( int age){
        this.age = age;
    }
    public void display( ) {
        System.out.println("姓名:"+ getName( )+ ",年龄:" + getAge( ) );
    }
}